package oa.system

import grails.compiler.GrailsCompileStatic
import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString

@GrailsCompileStatic
@EqualsAndHashCode(includes='code')
@ToString(includes='code,name', includeNames=true, includePackage=false)
class Func implements Serializable {

    private static final long serialVersionUID = 1

    String code
    String name
    String url

    Func(String code, String name, String url) {
        this.code = code;
        this.name = name;
        this.url = url;
    }

    static constraints = {
        code(maxSize: 4, nullable: false, blank: false, unique: true)
        name(maxSize: 50, nullable: false, blank: false)
        url(maxSize: 200, nullable: true, blank: true)
    }

    static mapping = {
        cache false
    }
}
